package com.tiantai.system.service.impl;

import java.util.List;
import com.tiantai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tiantai.system.mapper.TeaManagementMapper;
import com.tiantai.system.domain.TeaManagement;
import com.tiantai.system.service.ITeaManagementService;

/**
 * 茶叶份额Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Service
public class TeaManagementServiceImpl implements ITeaManagementService 
{
    @Autowired
    private TeaManagementMapper teaManagementMapper;

    /**
     * 查询茶叶份额
     * 
     * @param id 茶叶份额主键
     * @return 茶叶份额
     */
    @Override
    public TeaManagement selectTeaManagementById(Long id)
    {
        return teaManagementMapper.selectTeaManagementById(id);
    }

    /**
     * 查询茶叶份额列表
     * 
     * @param teaManagement 茶叶份额
     * @return 茶叶份额
     */
    @Override
    public List<TeaManagement> selectTeaManagementList(TeaManagement teaManagement)
    {
        return teaManagementMapper.selectTeaManagementList(teaManagement);
    }

    /**
     * 新增茶叶份额
     * 
     * @param teaManagement 茶叶份额
     * @return 结果
     */
    @Override
    public int insertTeaManagement(TeaManagement teaManagement)
    {
        teaManagement.setCreateTime(DateUtils.getNowDate());
        return teaManagementMapper.insertTeaManagement(teaManagement);
    }

    /**
     * 修改茶叶份额
     * 
     * @param teaManagement 茶叶份额
     * @return 结果
     */
    @Override
    public int updateTeaManagement(TeaManagement teaManagement)
    {
        teaManagement.setUpdateTime(DateUtils.getNowDate());
        return teaManagementMapper.updateTeaManagement(teaManagement);
    }

    /**
     * 批量删除茶叶份额
     * 
     * @param ids 需要删除的茶叶份额主键
     * @return 结果
     */
    @Override
    public int deleteTeaManagementByIds(Long[] ids)
    {
        return teaManagementMapper.deleteTeaManagementByIds(ids);
    }

    /**
     * 删除茶叶份额信息
     * 
     * @param id 茶叶份额主键
     * @return 结果
     */
    @Override
    public int deleteTeaManagementById(Long id)
    {
        return teaManagementMapper.deleteTeaManagementById(id);
    }
}
